/**
 * 
 */
package wangjg.xuexiban.widget;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * @author wangjg
 *
 */
public class MyViewPager extends ViewPager {

	private boolean diableTouch = false;

	public MyViewPager(Context context) {
		super(context);
	}

	public MyViewPager(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	public boolean dispatchTouchEvent(MotionEvent ev) {
		if(diableTouch && ev.getAction()==MotionEvent.ACTION_MOVE){
			return false;			
		}
		return super.dispatchTouchEvent(ev);
	}

	public void setDiableTouch(boolean disableScoll) {
		this.diableTouch = disableScoll;
	}
}
